package com.qf.service.Impl;

import com.qf.dao.UserDao;
import com.qf.pojo.User;
import com.qf.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;

import javax.annotation.PostConstruct;
import javax.annotation.PreDestroy;
import javax.annotation.Resource;

/**
 * @ClassName UserServiceImpl
 * @Description TODO
 * @Author Windy
 * @Date 2022/8/30 11:34
 * @Version 1.0
 **/
@Service
@Scope(value = "prototype")
public class UserServiceImpl implements UserService {

    @Autowired
    @Qualifier("userDaoImpl1")
//    @Resource
    UserDao userDao;
    @Override
    public void addUser() {
        userDao.addUser();
        System.out.println("userService:addUser()....");
    }

    public UserServiceImpl(){
        System.out.println("UserServiceImpl().....");
    }
    @PostConstruct
    public void init(){
        System.out.println("init..");
    }

    @PreDestroy
    public void desy(){
        System.out.println("dest....");
    }
}
